angular.module('homeApp', [])
    .controller('homeCtrl', ['$scope', '$location', function ($scope, $location) {
        $scope.title = 'home page controller.';
        $scope.datas = [{
            id: 1,
            name: 'apple',
            price: 8,
            num: 10
        }, {
            id: 2,
            name: 'banana',
            price: 4,
            num: 13
        }, {
            id: 3,
            name: 'orange',
            price: 6,
            num: 30
        }, {
            id: 4,
            name: 'grape',
            price: 5,
            num: 15
        }];
        $scope.test = 1000000 * 6.89;

        $scope.numDesc = false;
        $scope.orderByNum = function () {
            $scope.numDesc = !$scope.numDesc;
            $scope.order = $scope.numDesc ? '-num' : 'num';

        };
        console.log($location.search());
    }]);